Skip to content

gui/quickfort: show smoothing designations immediately - #5925

Open
Alistair-Afton wants to merge 1 commit into
DFHack:developfrom
Alistair-Afton:fix-quickfort-smooth-visibility
Open

Alistair-Afton wants to merge 1 commit into
DFHack:developfrom
Alistair-Afton:fix-quickfort-smooth-visibility

Conversation

@Alistair-Afton

Copy link
Copy Markdown
Contributor

Summary

  • allow overlays attached to native viewscreens to match DFHack Lua screens layered over them
  • activate the existing ASCII designation renderer while gui/quickfort is open
  • add an in engine regression test for overlay render dispatch

Fixes #5759.

Testing

  • test -d C:/Users/Alistair Afton/source/repos/dfhack/test -t dig
  • verified the designation overlay dispatches while the gui/quickfort focus path is active
  • Release build completed successfully

@Alistair-Afton
Alistair-Afton force-pushed the fix-quickfort-smooth-visibility branch 2 times, most recently from e229361 to 636cd48 Compare September 17, 2026 15:50
Comment thread plugins/lua/overlay.lua
if dfhack.gui.matchFocusString(fs, vs) then
return true
end
local lua_focus = fs:match('^[^/]+/(dfhack/lua/.*)$')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note for posterity: this regex looks okay. it should resolve quickly into a match or not-match.
it is, in general, a bad idea to have two or more unbounded matches such as .* in a regex.
in this case, the regex is clamped to the start and end of the string, and the first subexpression [^/]+ will consume characters up to the first /. no backtracking is possible, and no backtracking would be possible even if this were a true regex instead of Lua's poor-man's regex.

@SilasD SilasD left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not really understand the innards of the overlay system, but this looks reasonable and minimal.

Edit: I don't know if it will work in graphics mode. I also don't know if the original issue was for graphics mode, text mode, or both. it's still reasonable code but the issue shouldn't be closed until Bumber64 weighs in.

Allow native viewscreen overlays to match a DFHack Lua screen layered over the native screen. Register the designation renderer for gui/quickfort so smoothing designations are visible immediately after blueprint placement.
@Alistair-Afton
Alistair-Afton force-pushed the fix-quickfort-smooth-visibility branch from 636cd48 to 43f8540 Compare September 18, 2026 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue: gui/quickfort smooth designations invisible

2 participants